|
|
|
 | By centering the control where the mouse is, it looks a little better since the control wont jump around the screen as much. For a completed example of this, you can look at the sample file Drag1.frm, as shown in Figure 32.2. Examples Filename: Drag1.frm | | | | |
|
|
|
|
Figure 32.2
The first example of drag and drop. |
|
|
|
|
|
|
|
|
|
|
Most applications have a nice icon that displays when you start dragging a particular control or data. Just by setting the DragIcon property, you can add this functionality to your drag-and-drop operation. |
|
|
|
|
| Add a DragIcon 1. Go back to design mode on the form. 2. Click the label control one time to give it focus. 3. In the Properties window for the label control, double-click the DragIcon property. 4. Locate the Bullseye.ico file in the folder for this chapter. Click the OK button on the Open dialog box to set this property. 5. Run the application again and see what happens when you start to drag the label around the form. |  | It is nice to give the user a good visual clue that the control is now moving by setting the DragIcon property. |
|
|
|